<Schema name="DTMModbusDeviceSchema" 
	xmlns="urn:schemas-microsoft-com:xml-data" 
	xmlns:fdt="x-schema:FDTDataTypesSchema.xml" 
	xmlns:dt="urn:schemas-microsoft-com:datatypes" 	
	xmlns:mb = "x-schema:FDTModbusAddressSchema.xml">


	<!--FDT V1.2 device schema for Modbus protocol V1.0 -->
	<!-- The  FDT DTMModbusDevice schema defines the mapping of the Modbus identification objects -->
	<!-- to standard FDT identification elements for FDT V1.2 -->
	<!-- The Modbus identification objects can be read with the standard Modbus service ReadDeviceIdentification -->

	<!--Definition of general Fdt attributes-->
	<AttributeType name = "schemaVersion" dt:type = "number" default = "1.0"/>

	<!-- Definition of general FDT elements which contain the information about the applied protocol -->
	<!-- and the version of the protocol -->
	<AttributeType name = "protocolName" dt:type = "string" default = "protocol_Modbus"/>



	<!-- The mapping of Modbus identification objects to FDT identification elements is divided into two categories: -->

	<!-- - Basic category: -->
	<!--   Mapping of mandatory Modbus identification objects to required (mandatory) FDT identification elements -->


	<!--Modbus identification object VendorName -->
	<AttributeType name = "vendorName" dt:type = "string"/>
	<!--Modbus identification object ProductCode  -->
	<AttributeType name = "productCode" dt:type = "string"/>
	<!--Modbus identification object MajorMinorRevision  -->
	<AttributeType name = "majorMinorRevision" dt:type = "string"/>


	<!-- - Regular category: -->
	<!--   Mapping of optional Modbus identification objects to the optional FDT identification element IdValue-->
	<AttributeType name = "name" dt:type = "enumeration" dt:values = "ProductName ModelName VendorURL UserApplicationName"/>
	<AttributeType name = "protocolSpecificName" dt:type = "enumeration" dt:values = "ProductName ModelName VendorURL UserApplicationName"/>
	<AttributeType name = "value" dt:type = "string"/>


	<!-- Basic category: -->
	<!-- Mapping of Modbus identification elements required by the FDT DTMDeviceTypeIdent schema-->
	<!-- These elements represent all mandatory objects for Modbus device identification (basic category) -->

	<!--Modbus identification object VendorName is mapped to FDT element IdManufacturer -->
	<ElementType name = "IdManufacturer" content = "empty"  model = "closed">
		<attribute type = "vendorName" required="yes"/>
	</ElementType>

	<!--Modbus identification object ProductCode is mapped to FDT element IdTypeID -->
	<ElementType name = "IdTypeID" content = "empty"  model = "closed">
		<attribute type = "productCode" required="yes"/>
	</ElementType>

	<!--Modbus identification object MajorMinorRevision is mapped to FDT element IdSoftwareRevision -->
	<ElementType name = "IdSoftwareRevision" content = "empty"  model = "closed">
		<attribute type = "majorMinorRevision" required="yes"/>
	</ElementType>
    
    

	<!--Definition Modbus identification element not mandatory by the FDT DTMDeviceTypeIdent schema-->
	<!--This element represent all  objects for Modbus device identification (regular category) -->
	

	<ElementType name="IdValue" content="empty" model="closed">
        <attribute type="name" required="yes"/>
		<attribute type="value" required="yes"/>
		<attribute type="protocolSpecificName" required="yes"/>
	</ElementType>

	<ElementType name="IdValues" content="eltOnly" model="closed">
		<element type="IdValue" minOccurs="0" maxOccurs="*"/>
	</ElementType>


	<ElementType name="ModbusDevice" content="eltOnly" model="closed">
		<attribute type="fdt:nodeId" required="no"/>
		<attribute type="schemaVersion" required="no"/>
		<attribute type="protocolName" required="yes"/>
		<!-- Address information for Modbus TCP and Modbus Serial Line Devices  -->
		<group order = "one" maxOccurs="1" minOccurs="1">
			<element type = "mb:ModbusSerial"/>
			<element type = "mb:ModbusTCP"/>
		</group>
		<element type = "IdManufacturer" minOccurs="1" maxOccurs="1"/>
		<element type = "IdTypeID" minOccurs="1" maxOccurs="1"/>
		<element type = "IdSoftwareRevision" minOccurs="1" maxOccurs="1"/>
		<element type = "IdValues" minOccurs = "0" maxOccurs = "1"/>
	</ElementType>


</Schema>


